{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}Oracle到PolarDB-PG迁移平台{% endblock %}</title>
    <!-- Bootstrap CSS -->
    <link href="{% static 'bootstrap-5.3.5/css/bootstrap.min.css' %}" rel="stylesheet" integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
    <!-- Font Awesome -->
    <link href="{% static 'css/all.min.css' %}" rel="stylesheet">
    <!-- Custom CSS -->
    <link href="{% static 'css/custom.css' %}" rel="stylesheet">
    <link href="{% static 'css/content.css' %}" rel="stylesheet">
    <style>
        :root {
            --primary-color: #1890ff;
            --secondary-color: #096dd9;
            --success-color: #52c41a;
            --warning-color: #faad14;
            --danger-color: #f5222d;
            --info-color: #1890ff;
            --text-color: rgba(0, 0, 0, 0.65);
            --border-color: #e8e8e8;
            --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
            --sidebar-bg: #001529;
            --sidebar-text: rgba(255, 255, 255, 0.85);
            --sidebar-active: #1890ff;
            --content-max-width: 1400px;
            --content-padding: 24px;
        }
        
        /* 修改菜单箭头样式 */
        .nav-item {
            position: relative;
        }

        .nav-link {
            position: relative;
            padding-right: 25px !important;
            display: flex;
            align-items: center;
            color: var(--sidebar-text);
            transition: all 0.3s;
        }
        
        .nav-link:hover {
            color: white;
        }
        
        .nav-link.active {
            color: white;
            background-color: var(--sidebar-active);
        }

        .nav-item .fa-chevron-down,
        .nav-item .fa-chevron-right {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 0.75rem;
            color: rgba(255, 255, 255, 0.8);
            transition: transform 0.3s ease;
        }

        /* 添加展开/收起动画 */
        .nav-item.expanded .fa-chevron-right {
            transform: translateY(-50%) rotate(90deg);
        }

        .nav-item .nav-link:hover .fa-chevron-down,
        .nav-item .nav-link:hover .fa-chevron-right {
            color: rgba(255, 255, 255, 1);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background-color: #f0f2f5;
            color: var(--text-color);
            padding: 0;
            margin: 0;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }
        
        .navbar {
            box-shadow: var(--box-shadow);
            padding: 0;
            background-color: var(--sidebar-bg) !important;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
        }
        
        .navbar-brand {
            font-weight: 600;
            padding: 12px 24px;
            background-color: rgba(255, 255, 255, 0.05);
        }
        
        .content-wrapper {
            margin-top: 56px; /* 导航栏高度 */
            min-height: calc(100vh - 56px);
            display: flex;
            flex-direction: column;
            background-color: #f0f2f5;
        }
        
        .content-container {
            flex: 1;
            width: 100%;
            max-width: var(--content-max-width);
            margin: 0 auto;
            padding: var(--content-padding);
            box-sizing: border-box;
        }
        
        .dashboard-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 24px;
        }
        
        .stat-card {
            background: #fff;
            border-radius: 4px;
            padding: 20px;
            box-shadow: var(--box-shadow);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        
        .stat-card .stat-icon {
            font-size: 24px;
            width: 48px;
            height: 48px;
            border-radius: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 16px;
        }
        
        .stat-card .stat-content {
            flex: 1;
        }
        
        .stat-card .stat-value {
            font-size: 24px;
            font-weight: 600;
            line-height: 1.4;
            margin: 0;
        }
        
        .stat-card .stat-label {
            color: rgba(0, 0, 0, 0.45);
            font-size: 14px;
            margin: 0;
        }
        
        .quick-actions {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
            margin-bottom: 24px;
        }
        
        .action-button {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            background: #fff;
            border-radius: 4px;
            box-shadow: var(--box-shadow);
            color: var(--text-color);
            text-decoration: none;
            transition: all 0.3s;
        }
        
        .action-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            color: var(--primary-color);
        }
        
        .action-button i {
            font-size: 20px;
            margin-right: 8px;
        }
        
        .footer {
            margin-top: auto;
            padding: 16px 0;
            text-align: center;
            color: rgba(0, 0, 0, 0.45);
            font-size: 14px;
            background-color: #fff;
            border-top: 1px solid var(--border-color);
        }
        
        .btn-primary {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }
        
        .btn-success {
            background-color: var(--success-color);
            border-color: var(--success-color);
        }
        
        .btn-warning {
            background-color: var(--warning-color);
            border-color: var(--warning-color);
        }
        
        .btn-danger {
            background-color: var(--danger-color);
            border-color: var(--danger-color);
        }
        
        .btn-info {
            background-color: var(--info-color);
            border-color: var(--info-color);
        }
        
        .btn {
            border-radius: 4px;
            transition: all 0.3s;
        }
        
        .form-control, .form-select {
            border-radius: 4px;
            border: 1px solid var(--border-color);
            padding: 8px 12px;
            height: auto;
            transition: all 0.3s;
        }
        
        .form-control:focus, .form-select:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
        }
        
        .table {
            color: var(--text-color);
        }
        
        /* 子菜单样式 */
        .submenu {
            list-style: none;
            padding-left: 0;
            margin: 0;
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
        }
        
        .nav-item.expanded .submenu {
            max-height: 500px;
        }
        
        .submenu .nav-link {
            padding-left: 48px;
            font-size: 0.9rem;
        }
    </style>
    {% block extra_css %}{% endblock %}
</head>
<body>
    <!-- 顶部导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark">
        <div class="container-fluid">
            <a class="navbar-brand" href="{% url 'migration_app:index' %}">
                <i class="fas fa-database me-2"></i>Oracle到PolarDB-PG迁移工具
            </a>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="#" id="user-dropdown" data-bs-toggle="dropdown">
                            <i class="fas fa-user me-1"></i>用户
                        </a>
                        <ul class="dropdown-menu dropdown-menu-end">
                            <li><a class="dropdown-item" href="/admin/"><i class="fas fa-cog me-2"></i>系统管理</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item" href="/admin/logout/"><i class="fas fa-sign-out-alt me-2"></i>退出登录</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <!-- 主内容包装器 -->
    <div class="content-wrapper">
        <!-- 主内容容器 -->
        <div class="content">
            {% if messages %}
            <div class="messages mb-4">
                {% for message in messages %}
                <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
                    {{ message }}
                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                </div>
                {% endfor %}
            </div>
            {% endif %}

            {% block content %}{% endblock %}
        </div>

        <footer class="footer">
            <div class="content-container">
                <p>&copy; 2024 Oracle到PolarDB-PG迁移工具 | <a href="https://www.alibabacloud.com/product/polardb" target="_blank">Alibaba Cloud PolarDB</a></p>
            </div>
        </footer>
    </div>

    <!-- jQuery -->
    <script src="{% static 'js/jquery.min.js' %}"></script>
    {% comment %} <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script> {% endcomment %}
    <!-- Bootstrap Bundle with Popper -->
    <script src="{% static 'bootstrap-5.3.5/js/bootstrap.bundle.min.js' %}"></script>
    <!-- Chart.js -->
    <script src="{% static 'js/chart.min.js' %}"></script>
    <!-- Custom JS -->
    <script src="{% static 'js/custom.js' %}"></script>
    <!-- SweetAlert2 -->
    {% comment %} <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> {% endcomment %}
    <script src="{% static 'js/sweetalert2.js' %}"></script>
    
    <script>
        // 通用函数
        function showLoader() {
            console.log('加载动画已禁用');
        }
        
        function hideLoader() {
            console.log('加载动画已禁用');
        }
        
        function showToast(title, icon) {
            Swal.fire({
                title: title,
                icon: icon,
                toast: true,
                position: 'top-end',
                showConfirmButton: false,
                timer: 3000,
                timerProgressBar: true
            });
        }
        
        // 页面加载
        document.addEventListener('DOMContentLoaded', function() {
            // 为所有表单添加加载动画
            document.querySelectorAll('form').forEach(form => {
                // 已移除加载动画调用
            });
            
            // 为所有跳转链接添加加载动画
            document.querySelectorAll('a[href]:not([href^="#"])').forEach(link => {
                // 已移除加载动画调用
            });
        });
    </script>
    
    {% block scripts %}{% endblock %}
    {% block scripts_1 %}{% endblock %}
</body>
</html> 